home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / WebSites / Wirenet / files / Dashboard2.lha / Dashboard2 / AmiTCP / Dashboard next >
Text File  |  1998-04-23  |  22KB  |  796 lines

  1. G4C
  2. ; $VER: Dashboard 2.0 (25.3.98)
  3. ; (c) Neil Bothwick
  4.  
  5. ;;;OnLoad
  6. xONLOAD                         ; To be done on loading the GUI
  7.     Set OUTPUT CON:450/678/400/90/Dashboard/CLOSE/INACTIVE/AUTO
  8.     ;Set OUTPUT NIL:
  9.     MainGui    = 'Dashboard'
  10.     GOSUB $MainGui SetUp
  11. ;;;
  12. ;;; OnReload
  13. xONRELOAD                       ; Or reloading the GUI
  14.     Set OUTPUT CON:350/658/500/110/Dashboard/CLOSE/INACTIVE/AUTO
  15.     ;Set OUTPUT NIL:
  16.     MainGui  = 'Dashboard'
  17.     GOSUB $MainGui SetUp
  18. ;;;
  19. ;;; Define main window
  20. WINBIG 15 15 339 131 'Wirenet Dashboard'   ; Specify a window
  21. WINTYPE 0111000
  22. BOX 0 56 339 2 OUT RIDGE
  23. xOnOpen
  24.     ChangeArg $MainGui 240 4 '$ButtonA'
  25.     ChangeArg $MainGui 250 4 '$ButtonB'
  26.     ChangeArg $MainGui 241 1 '$ButtonA'
  27.     ChangeArg $MainGui 251 1 '$ButtonB'
  28.  
  29. ;;;
  30. ;;; Connect
  31. xBUTTON 5  2 160 16 '_Connect'
  32.     GadID 100
  33.     GadHelp 'Connects, or sends events if already online'
  34.     GOSUB $MainGui Connect
  35.  
  36.  
  37. xCYCLER 175  2 160 16 '' 'ConnectOpt'
  38.     GadID 130
  39.     GadHelp 'What happens after connecting'
  40.     GadKey 1
  41.     CSTR 'Open (1)' Open
  42.     CSTR 'Mail (1)' Mail
  43.     CSTR 'News (1)' News
  44.     CSTR 'AutoMail (1)' AutoMail
  45.     CSTR 'AutoNews (1)' AutoNews
  46.  
  47. xROUTINE Connect
  48.     if $ConnectOpt == 'Open'
  49.         ConnectOpt = ''
  50.         EndIf
  51.     GOSUB $MainGui BusyRun 'Connect $ConnectOpt'
  52. ;;;
  53. ;;; Disconnect
  54. xBUTTON 5  19 160 16 '_Disconnect'
  55.     GadID 110
  56.     GadHelp 'Disconnects, immediately or when transfers finish'
  57.     GOSUB $MainGui Disconnect
  58.  
  59. xCYCLER 175  19 160 16 '' 'DisconnnectOpt'
  60.     GadID 140
  61.     GadHelp 'Whether to disconnect now or when transfers are complete'
  62.     GadKey 2
  63.     CSTR 'Now (2)' Now
  64.     CSTR 'Wait (2)' Wait
  65.  
  66. xROUTINE Disconnect
  67.     if $DisconnectOpt == 'Now'
  68.         DisconnectOpt = ''
  69.         EndIf
  70.     GOSUB $MainGui BusyRun 'Disconnect $DisconnnectOpt'
  71. ;;;
  72. ;;; Get
  73. xBUTTON 5  36 160 16 '_Get'
  74.     GadID 120
  75.     GadHelp 'Fetches mail and/or news, according to cycle gadget setting'
  76.     GOSUB $MainGui Get
  77.  
  78. xCYCLER 175  36 160 16 '' 'GetOpt'
  79.     GadID 150
  80.     GadHelp 'Selects whether Get fetches mail, news of both'
  81.     GadKey 3
  82.     CSTR 'Mail (3)' Mail
  83.     CSTR 'News (3)' News
  84.     CSTR 'All (3)' All
  85.  
  86. xROUTINE Get
  87.     GOSUB $MainGui BusyRun 'Run >NIL: Fetch $GetOpt'
  88. ;;;
  89. ;;; WWW
  90. xBUTTON 5 62  160 16 '_World Wide Web'
  91.     GadID 200
  92.     GadHelp 'Starts your chosen Web browser'
  93.     GOSUB $MainGui WWW
  94.  
  95. xROUTINE WWW
  96.     GOSUB $MainGui BusyRun 'RUN >NIL: $WWW'
  97. ;;;
  98. ;;; Browse news
  99. xBUTTON 5 79  160 16 '_Browse News'
  100.     GadID 220
  101.     GadHelp 'Starts the online news browser'
  102.     GOSUB $MainGui BrowseNews
  103.  
  104. xROUTINE BrowseNews
  105.     CLI 'CheckOnline >NIL:'
  106.     If $$RETCODE = 0
  107.         GOSUB $MainGui BusyRun 'RUN >NIL: $Browse'
  108.     Else
  109.         GuiWindow $MainGui WAIT
  110.         EZReq 'You need to be online to use this function' 'OK' nil
  111.         GuiWindow $MainGui RESUME
  112.     EndIf
  113. ;;;
  114. ;;; User A
  115. xBUTTON 5 96  160 15 '              '
  116.     GadID 240
  117.     GadHelp 'This button is user configurable, see Help for more information'
  118.     GadKey 4
  119.     GOSUB $MainGui UserA
  120.  
  121. xROUTINE UserA
  122.     GOSUB $MainGui BusyRun '$UserA'
  123. ;;;
  124. ;;; Exit
  125. xBUTTON 5 113 160 16 'E_xit'
  126.     GadID 260
  127.     GadHelp 'Closes Dashboard, leaving other programs running'
  128.     Quit
  129. ;;;
  130. ;;; FTP
  131. xBUTTON 175 62  160 16 '_File Transfer'
  132.     GadID 210
  133.     GadHelp 'Starts your chosen FTP program'
  134.     GOSUB $MainGui FTP
  135.  
  136. xROUTINE FTP
  137.     GOSUB $MainGui BusyRun 'RUN >NIL: $FTP'
  138. ;;;
  139. ;;; Mail/News
  140. xBUTTON 175 79  160 16 '_Read Mail/News'
  141.     GadID 230
  142.     GadHelp 'Starts Thor to read mail and news offline'
  143.     GOSUB $MainGui ReadNews
  144.  
  145. xROUTINE ReadNews
  146.     GOSUB $MainGui BusyRun 'Run >NIL: $Read'
  147. ;;;
  148. ;;; User B
  149. xBUTTON 175 96  160 16 '              '
  150.     GadID 250
  151.     GadHelp 'This button is user configurable, see Help for more information'
  152.     GadKey 5
  153.     GOSUB $MainGui UserB
  154.  
  155. xROUTINE UserB
  156.     GOSUB $MainGui BusyRun '$UserB'
  157. ;;;
  158. ;;; Quit
  159. xBUTTON 175 113 160 16 'Quit'
  160.     GadID 270
  161.     GadHelp 'Quits Dashboard, closing TCP and taking you offline'
  162.     GOSUB $MainGui Quit
  163.  
  164. xROUTINE Quit
  165.     GuiWindow $MainGui WAIT
  166.     CLI 'StopNet'
  167.     if $$RETCODE = 0
  168.         GuiClose $MainGui
  169.         Quit
  170.         endif
  171.     GuiWindow $MainGui RESUME
  172. ;;;
  173. ;;; Project Menu
  174. xMENU 'Project' 'Help' '' 'H'
  175.     RUN 'MultiView Wirenet:doc/Dashboard.guide'
  176.  
  177. xMENU 'Project' 'About' '' '?'
  178.     AboutMsg = 'Wirenet Dashboard 2.0 (c) Neil Bothwick, 1996-7\nCreated using Gui4Cli by D.C.Keletsekis'
  179.     EZReq '$AboutMsg' 'OK' nil
  180.  
  181. xMENU 'Project' 'Prefs...' '' 'P'
  182.     GuiClose $MainGui
  183.     GuiOpen $PrefsGui
  184.     GuiWindow $PrefsGui WAIT
  185.     RUN 'WirenetPrefs COPY'
  186.     GuiWindow $PrefsGui RESUME
  187.  
  188. xMENU 'Project' 'Exit' '' 'X'
  189.     Quit
  190.  
  191. xMENU 'Project' 'Quit' '' 'Q'
  192.     GOSUB $MainGui Quit
  193. ;;;
  194. ;;;Commands menu
  195. xMENU 'Command' 'Connect' 'Open' ''
  196.     Update $MainGui 130 0
  197.     GOSUB $MainGui Connect
  198.  
  199. xMENU 'Command' 'Connect' 'Mail' ''
  200.     Update $MainGui 130 1
  201.     GOSUB $MainGui Connect
  202.  
  203. xMENU 'Command' 'Connect' 'News' ''
  204.     Update $MainGui 130 2
  205.     GOSUB $MainGui Connect
  206.  
  207. xMENU 'Command' 'Connect' 'AutoMail' ''
  208.     Update $MainGui 130 3
  209.     GOSUB $MainGui Connect
  210.  
  211. xMENU 'Command' 'Connect' 'AutoNews' ''
  212.     Update $MainGui 130 4
  213.     GOSUB $MainGui Connect
  214.  
  215. xMENU 'Command' 'Disconnect' 'Now' ''
  216.     Update $MainGui 140 0
  217.     GOSUB $MainGui Disconnect
  218.  
  219. xMENU 'Command' 'Disconnect' 'Wait' ''
  220.     Update $MainGui 140 1
  221.     GOSUB $MainGui Disconnect
  222.  
  223. xMENU 'Command' 'Get' 'Mail' ''
  224.     Update $MainGui 150 0
  225.     GOSUB $MainGui Get
  226.  
  227. xMENU 'Command' 'Get' 'News' ''
  228.     Update $MainGui 150 1
  229.     GOSUB $MainGui Get
  230.  
  231. xMENU 'Command' 'Get' 'All' ''
  232.     Update $MainGui 150 2
  233.     GOSUB $MainGui Get
  234.  
  235. xMENU 'Command' 'WWW' '' ''
  236.     GOSUB $MainGui WWW
  237.  
  238. xMenu 'Command' 'FTP' '' ''
  239.     GOSUB $MainGui FTP
  240.  
  241. xMENU 'Command' 'Browse News' '' ''
  242.     GOSUB $MainGui BrowseNews
  243.  
  244. xMENU 'Command' 'Read Mail/News' '' ''
  245.     GOSUB $MainGui ReadNews
  246.  
  247. xMENU 'Command' 'User A        ' '' ''
  248.     GadID 241
  249.     GOSUB $MainGui UserA
  250.  
  251. xMENU 'Command' 'User B        ' '' ''
  252.     GadID 251
  253.     GOSUB $MainGui UserB
  254. ;;;
  255. ;;; Initial setup
  256. xROUTINE SetUp
  257. ;    SET DEBUG ON
  258.     SET HELP ON
  259.     CD 'Wirenet:bin'
  260.     PrefsGui   = 'Prefs.g'
  261.     DialerGui  = 'Dialer.g'
  262.     AddressGui = 'Address.g'
  263.     UserGui    = 'User.g'
  264.     FTPGui     = 'FTP.g'
  265.     PrefsFile  = 'Wirenet.prefs'
  266.     PrefsPath  = 'ENV:$PrefsFile'
  267.     Set EDITOR "Run >NIL: c:dme"
  268.     GOSUB $MainGui BusyRun 'Wirenet:bin/StartNet'
  269.     GOSUB $MainGui ReadConfig
  270.     Update $MainGui 130 1
  271.     Update $MainGui 140 0
  272.     Update $MainGui 150 1
  273.     ChangeArg $MainGui 240 4 '$ButtonA'
  274.     ChangeArg $MainGui 250 4 '$ButtonB'
  275.     ChangeArg $MainGui 241 1 '$ButtonA'
  276.     ChangeArg $MainGui 251 1 '$ButtonB'
  277.     GuiOpen $MainGui         ; Open the GUI's window
  278.     Return
  279. ;;;
  280. ;;; Read configuration
  281. xROUTINE ReadConfig
  282.     CLI 'rx "say getclip(""ButtonA"")" >ENV:.temp'
  283.     ButtonA = $.temp
  284.     CLI 'rx "say getclip(""ButtonB"")" >ENV:.temp'
  285.     ButtonB = $.temp
  286.     CLI 'rx "say getclip(""WWW"")" >ENV:.temp'
  287.     WWW = $.temp
  288.     CLI 'rx "say getclip(""FTP"")" >ENV:.temp'
  289.     FTP = $.temp
  290.     ;WWW    = 'AWeb3:Aweb-II'
  291.     ;FTP    = 'Wirenet:AmiFTP'
  292.     Read   = 'Wirenet:Thor/Thor System=Wirenet FF'
  293.     Browse = 'Wirenet:Thor/ConnectThor Wirenet BROWSENEWS'
  294.     UserA  = 'Wirenet:UserScripts/Function.A'
  295.     UserB  = 'Wirenet:UserScripts/Function.B'
  296.     Return
  297. ;;;
  298. ;;; BusyRun
  299. xROUTINE BusyRun BusyCmd
  300.     GuiWindow $MainGui WAIT
  301.     say "$BusyCmd\n"
  302.     CLI '$BusyCmd'
  303.     GuiWindow $MainGui RESUME
  304.     Return
  305. ;;;
  306. ;;; Use Prefs
  307. xROUTINE UsePrefs
  308.     GuiWindow $PrefsGui WAIT
  309.     CLI 'Delete >NIL: $PrefsPath'
  310.     CLI 'Echo "# Wirenet preferences file" >T:$PrefsFile'
  311.  
  312.     Append T:$PrefsFile '\n# Dialer preferences\n'
  313.     Append T:$PrefsFile 'PopNum: $PopNum\n'
  314.     Append T:$PrefsFile 'ModemDev: $ModemDev\n'
  315.     Append T:$PrefsFile 'ModemSpeed: $ModemSpeed\n'
  316.     Append T:$PrefsFile 'ModemInit: $ModemInit\n'
  317.     Append T:$PrefsFile 'ModemDial: $ModemDial\n'
  318.     Append T:$PrefsFile 'PPPoptions: $PPPoptions\n'
  319.     Append T:$PrefsFile 'MTU: $MTU\n'
  320.     Append T:$PrefsFile 'DialWindow: $DialWindow\n'
  321.     Append T:$PrefsFile 'UsePAP: $UsePAP\n'
  322.     Append T:$PrefsFile 'TCPstack: $TCPstack\n'
  323.  
  324.     Append T:$PrefsFile '\n# User preferences\n'
  325.     Append T:$PrefsFile 'UserName: $UserName\n'
  326.     Append T:$PrefsFile 'NodeName: $NodeName\n'
  327.     Append T:$PrefsFile 'MailBox: $MailBox\n'
  328.     Append T:$PrefsFile 'DomainName: $DomainName\n'
  329.     Append T:$PrefsFile 'IPAddress: $IPAddress\n'
  330.     Append T:$PrefsFile 'Password: $Password\n'
  331.  
  332.     Append T:$PrefsFile '\n# Address preferences\n'
  333.     Append T:$PrefsFile 'Gateway: $Gateway\n'
  334.     Append T:$PrefsFile 'MailServer: $MailServer\n'
  335.     Append T:$PrefsFile 'NewsServer: $NewsServer\n'
  336.     Append T:$PrefsFile 'SMTPServer: $SMTPServer\n'
  337.     Append T:$PrefsFile 'NewsSockets: $NewsSockets\n'
  338.     Append T:$PrefsFile 'MaxTries: $MaxTries\n'
  339.  
  340.     Append T:$PrefsFile '\n# FTP preferences\n'
  341.     Append T:$PrefsFile 'AminetServer: $AminetServer\n'
  342.     Append T:$PrefsFile 'DownloadDir: $DownloadDir\n'
  343.     Append T:$PrefsFile 'AminetRoot: $AminetRoot\n'
  344.     Append T:$PrefsFile 'GetReadme: $GetReadme\n'
  345.  
  346.     Append T:$PrefsFile 'WWW: $WWW\n'
  347.     Append T:$PrefsFile 'FTP: $FTP\n'
  348.     Append T:$PrefsFile 'ButtonA: $ButtonA\n'
  349.     Append T:$PrefsFile 'ButtonB: $ButtonB\n'
  350.  
  351.     CLI 'Copy T:$PrefsFile $PrefsPath clone'
  352.     CLI 'Delete >NIL: T:$PrefsFile'
  353.     CLI 'WirenetPrefs LOAD'
  354.     GuiWindow $PrefsGui RESUME
  355.     Return
  356. ;;;
  357.  
  358. ;;; *** Prefs Window ***
  359. NEWFILE Prefs.g
  360. VarPath 'Dashboard'
  361. WINBIG 15 15 285 90 'Wirenet Preferences'   ; Specify a window
  362. WINTYPE 0111000
  363. ;;;
  364. ;;; Dialer
  365. xBUTTON 15  5 120 20 '_Dialer'
  366.     GadHelp 'Edit dialer preferences'
  367.     GuiClose $PrefsGui
  368.     GuiOpen $DialerGui
  369. ;;;
  370. ;;; Addresses
  371. xBUTTON 150  5 120 20 '_Addresses'
  372.     GadHelp 'Change system addresses'
  373.     GuiClose $PrefsGui
  374.     GuiOpen $AddressGui
  375. ;;;
  376. ;;; User
  377. xBUTTON 15  30 120 20 '_User'
  378.     GadHelp 'Edit user information'
  379.     GuiClose $PrefsGui
  380.     GuiOpen $UserGui
  381. ;;;
  382. ;;; FTP
  383. xBUTTON 150  30 120 20 '_FTP'
  384.     GadHelp 'Change settings for Aminet downloads via Thor'
  385.     GuiClose $PrefsGui
  386.     GuiOpen $FTPGui
  387. ;;;
  388. ;;; Save
  389. xBUTTON 15 60 61 20 '_Save'
  390.     GadHelp 'Save preferences'
  391.     Gosub $MainGui UsePrefs
  392.     CLI 'Copy >NIL: $PrefsPath ENVARC:'
  393.     Gosub $PrefsGui ExitPrefs
  394. ;;;
  395. ;;; Use
  396. xBUTTON 112 60 61 20 '_Use'
  397.     GadHelp 'Use preferences for this session'
  398.     Gosub $MainGui UsePrefs
  399.     Gosub $PrefsGui ExitPrefs
  400. ;;;
  401. ;;; Cancel
  402. xBUTTON 209 60 61 20 '_Cancel'
  403.     GadHelp 'Exit without making any changes'
  404.     Gosub $PrefsGui ExitPrefs
  405. ;;;
  406. ;;; Menu
  407. xMENU 'Project' 'Last Saved' '' 'L'
  408.     GuiWindow $PrefsGui WAIT
  409.     CLI 'Copy >NIL: ENVARC:$PrefsFile ENV:'
  410.     CLI 'WirenetPrefs LOAD'
  411.     RUN 'WirenetPrefs COPY'
  412.     GuiWindow $PrefsGui RESUME
  413. xMENU 'Project' 'Help' '' 'H'
  414.     RUN 'MultiView Wirenet:doc/Dashboard.guide'
  415. ;;;
  416. ;;; Exit Prefs
  417. xROUTINE ExitPrefs
  418. ;    GuiWindow $PrefsGui WAIT
  419. ;    CLI 'WirenetPrefs LOAD'
  420. ;    GuiWindow $PrefsGui RESUME
  421.     GuiClose 'Prefs.g'
  422.     GuiOpen 'Dashboard' ;$MainGui
  423.     Return
  424. ;;;
  425.  
  426. ;;; *** Dialer Window ***
  427. NEWFILE Dialer.g
  428. VarPath 'Dashboard'
  429. WINBIG 15 15 575 180 'Dialer Preferences'
  430. WINTYPE 0111000
  431. ;;;
  432. ;;; On Open
  433. xOnOPEN
  434.     PopNum.tmp = $PopNum
  435.     ModemDev.tmp = $ModemDev
  436.     MTU.tmp = $MTU
  437.     PPPoptions.tmp = $PPPoptions
  438.     ModemInit.tmp = $ModemInit
  439.     ModemDial.tmp = $ModemDial
  440.     DialWindow.tmp = $DialWindow
  441.     UsePAP.tmp = $UsePAP
  442.     TCPstack.tmp = $TCPstack
  443.     ModemSpeed.tmp = 2 ; default to 38400
  444.     DoCase $ModemSpeed
  445.         Case = 115200
  446.             ModemSpeed.tmp = 0
  447.             Break
  448.         Case = 57600
  449.             ModemSpeed.tmp = 1
  450.             Break
  451.         Case = 38400
  452.             ModemSpeed.tmp = 2
  453.             Break
  454.         Case = 19200
  455.             ModemSpeed.tmp = 3
  456.             Break
  457.         Case = 9600
  458.             ModemSpeed.tmp = 4
  459.             Break
  460.         Case = 4800
  461.             ModemSpeed.tmp = 5
  462.             Break
  463.         Case = 2400
  464.             ModemSpeed.tmp = 6
  465.             Break
  466.         EndCase
  467.  
  468.     Update $DialerGui 410 $ModemDev.tmp
  469.     Update $DialerGui 420 $ModemSpeed.tmp
  470.     Update $DialerGui 430 $ModemInit.tmp
  471.     Update $DialerGui 440 $ModemDial.tmp
  472.     Update $DialerGui 450 $PopNum.tmp
  473.     Update $DialerGui 460 $MTU.tmp
  474.     Update $DialerGui 470 $PPPoptions.tmp
  475.     Update $DialerGui 480 $DialWindow.tmp
  476.     Update $DialerGui 490 $UsePAP.tmp
  477.     Update $DialerGui 495 $TCPstack.tmp
  478. ;;;
  479. ;;; Gadgets
  480. xTEXTIN  115  10 200 20 'Serial De_vice' ModemDev.tmp '' 30
  481.     GadID 410
  482.     GadHelp 'The name of your serial device driver (case sensitive)'
  483. xCYCLER  430  10 110 20 'Serial _Speed' ModemSpeed.tmp
  484.     GadID 420
  485.     GadHelp 'Serial speed between your Amiga and modem'
  486.     CSTR '115200' 0
  487.     CSTR '57600'  1
  488.     CSTR '38400'  2
  489.     CSTR '19200'  3
  490.     CSTR '9600'   4
  491.     CSTR '4800'   5
  492.     CSTR '2400'   6
  493. xTEXTIN  115  35 200 20 'Modem _Init' ModemInit.tmp '' 100
  494.     GadID 430
  495.     GadHelp 'Initialisation string for your modem'
  496. xTEXTIN  430  35 110 20 'Modem _Dial' ModemDial.tmp '' 10
  497.     GadID 440
  498.     GadHelp 'Dial string for your modem - usually ATDT'
  499. xTEXTIN  115  60 200 20 '_Tel No' PopNum.tmp '' 30
  500.     GadID 450
  501.     GadHelp 'Telephone number to connect to - usually 0845 0798112'
  502. xTEXTIN  430  60 110 20 'M_TU' MTU.tmp '' 5
  503.     GadID 460
  504.     GadHelp 'Set to 576 for 28 or 33K modems, 1500 for 56K'
  505. xTEXTIN  115  85 200 20 '_PPP Options' PPPopts.tmp '' 100
  506.     GadID 470
  507.     GadHelp 'Additional configuration for ppp.device - do not change without reading ppp.guide'
  508. xTEXTIN  115 110 200 20 'Dial _Window' DialWindow.tmp '' 100
  509.     GadID 480
  510.     GadHelp 'Size of the dial information window'
  511. xCheckBox 430 85 21 17 'P_AP' UsePAP.tmp '1' '0' OFF
  512.     GadID 490
  513.     GadHelp 'Use PAP loginns - faster but needs registered ppp.device'
  514. xCYCLER 430 110 110 20 'TCP stack' TCPstack.tmp
  515.     GadID 495
  516.     GadHelp 'Use either AmiTCP or Miami, the other settings only apply to AmiTCP'
  517.     CSTR 'AmiTCP' 0
  518.     CSTR 'Miami'  1
  519. ;;;
  520. ;;; Buttons
  521. xBUTTON 200 150 60 25 '_OK'
  522.     GadHelp 'Accept these settings'
  523.     PopNum = $PopNum.tmp
  524.     ModemDev = $ModemDev.tmp
  525.     MTU = $MTU.tmp
  526.     PPPoptions = $PPPoptions.tmp
  527.     ModemInit = $ModemInit.tmp
  528.     ModemDial = $ModemDial.tmp
  529.     DialWindow = $DialWindow.tmp
  530.     UsePAP = $UsePAP.tmp
  531.     TCPstack = $TCPstack.tmp
  532.     ModemSpeed = 2 ; default to 38400
  533.     DoCase $ModemSpeed.tmp
  534.         Case = 0
  535.             ModemSpeed = 115200
  536.             Break
  537.         Case = 1
  538.             ModemSpeed = 57600
  539.             Break
  540.         Case = 2
  541.             ModemSpeed.tmp = 38400
  542.             Break
  543.         Case = 3
  544.             ModemSpeed.tmp = 19200
  545.             Break
  546.         Case = 4
  547.             ModemSpeed.tmp = 9600
  548.             Break
  549.         Case = 5
  550.             ModemSpeed.tmp = 4800
  551.             Break
  552.         Case = 6
  553.             ModemSpeed.tmp = 2400
  554.             Break
  555.         EndCase
  556.  
  557.     Gosub $DialerGui ExitDialer
  558.  
  559. xBUTTON 315 150 60 25 '_Cancel'
  560.     GadHelp 'Exit without changing settings'
  561.     Gosub $DialerGui ExitDialer
  562. ;;;
  563. ;;; Exit Window
  564. xROUTINE ExitDialer
  565.     GuiClose $DialerGui
  566.     GuiOpen $PrefsGui
  567.     Return
  568. ;;;
  569.  
  570. ;;; *** Address Window ***
  571. NewFile Address.g
  572. VarPath 'Dashboard/Prefs.g'
  573. WINBIG 15 15 575 130 'Address Preferences'
  574. WINTYPE 0111000
  575. ;;;
  576. ;;; On Open
  577. xOnOPEN
  578.     Gateway.tmp     = $Gateway
  579.     MailServer.tmp  = $MailServer
  580.     NewsServer.tmp  = $NewsServer
  581.     SMTPServer.tmp  = $SMTPServer
  582.     NewsSockets.tmp = $NewsSockets
  583.     MaxTries.tmp    = $MaxTries
  584.  
  585.     Update $AddressGui 610 $Gateway
  586.     Update $AddressGui 620 $MailServer
  587.     Update $AddressGui 630 $SMTPServer
  588.     Update $AddressGui 640 $NewsServer
  589.     Update $AddressGui 650 $NewsSockets
  590.     Update $AddressGui 660 $MaxTries
  591. ;;;
  592. ;;; Gadgets
  593. xTEXTIN  115  10 155 20 'Gateway' Gateway.tmp '' 20
  594.     GadID 610
  595.     GadHelp 'You should not need to change this'
  596. xTEXTIN  115  35 155 20 'Mail Server' MailServer.tmp '' 20
  597.     GadID 620
  598.     GadHelp 'The address of the POP3 mail server'
  599. xTEXTIN  115  60 155 20 'Send Mail To' SMTPServer.tmp '' 20
  600.     GadID 630
  601.     GadHelp 'The address to send outgoing mail'
  602. xTEXTIN  385  10 155 20 'News Server' NewsServer.tmp '' 20
  603.     GadID 640
  604.     GadHelp 'The address of the news server'
  605. xTEXTIN  385  35 155 20 'News Sockets' NewsSockets.tmp '' 20
  606.     GadID 650
  607.     GadHelp 'The number of sockets to use when downloading news'
  608. xTEXTIN  385  60 155 20 'Max Retries' MaxTries.tmp '' 20
  609.     GadID 660
  610.     GadHelp 'Number of times to retry if connection with mail or news fails'
  611. ;;;
  612. ;;; Buttons
  613. xBUTTON 200 100 60 25 '_OK'
  614.     GadHelp 'Accept these settings'
  615.     Gateway    = $Gateway.tmp
  616.     MailServer = $MailServer.tmp
  617.     NewsServer = $NewsServer.tmp
  618.     SMTPServer = $SMTPServer.tmp
  619.     NewsSockets = $NewsSockets.tmp
  620.     MaxTries    = $MaxTries.tmp
  621.     Gosub $AddressGui ExitAddress
  622.  
  623. xBUTTON 315 100 60 25 '_Cancel'
  624.     GadHelp 'Exit without changing settings'
  625.     Gosub $AddressGui ExitAddress
  626. ;;;
  627. ;;; Exit Window
  628. xROUTINE ExitAddress
  629.     GuiClose $AddressGui
  630.     GuiOpen $PrefsGui
  631.     Return
  632. ;;;
  633.  
  634. ;;; *** User Window ***
  635. NEWFILE User.g
  636. VarPath 'Dashboard/Prefs.g'
  637. WINBIG 15 15 575 175 'User Preferences'
  638. WINTYPE 0111000
  639. ;;;
  640. ;;; On Open
  641. xOnOPEN
  642.     UserName.tmp   = $UserName
  643.     NodeName.tmp   = $NodeName
  644.     MailBox.tmp    = $MailBox
  645.     DomainName.tmp = $DomainName
  646.     IPAddress.tmp  = $IPAddress
  647.     Password.tmp   = $Password
  648.     WWW.tmp        = $WWW
  649.     FTP.tmp        = $FTP
  650.     ButtonA.tmp    = $ButtonA
  651.     ButtonB.tmp    = $ButtonB
  652.  
  653.     Update $UserGui 510 $UserName.tmp
  654.     Update $UserGui 520 $NodeName.tmp
  655.     Update $UserGui 530 $MailBox.tmp
  656.     Update $UserGui 540 $DomainName.tmp
  657.     Update $UserGui 550 $IPAddress.tmp
  658.     Update $UserGui 560 $Password.tmp
  659.     Update $UserGui 570 $WWW.tmp
  660.     Update $UserGui 575 $FTP.tmp
  661.     Update $UserGui 580 $ButtonA.tmp
  662.     Update $UserGui 585 $ButtonB.tmp
  663. ;;;
  664. ;;; Gadgets
  665. xTEXTIN  115   10 155 20 'User Name' UserName.tmp '' 20
  666.     GadID 510
  667.     GadHelp 'The part before the @ in your email address'
  668. xTEXTIN  115   35 155 20 'Node Name' NodeName.tmp '' 20
  669.     GadID 520
  670.     GadHelp 'The first part after the @ in your email address'
  671. xTEXTIN  385   10 155 20 'Mailbox' MailBox.tmp '' 20
  672.     GadID 530
  673.     GadHelp 'The name of your mailbox on the POP3 server - usually the same as your Node Name'
  674. xTEXTIN  115   60 155 20 'Domain' DomainName.tmp '' 20
  675.     GadID 540
  676.     GadHelp 'Leave at .u-net.com'
  677. xTEXTIN  385   60 155 20 'IP Address' IPAddress.tmp '' 20
  678.     GadID 550
  679.     GadHelp 'Usually 0.0.0.0'
  680. xTEXTIN  385   35 155 20 'Password' Password.tmp '' 20
  681.     GadID 560
  682.     GadHelp 'Your password for logging into your account and mailbox'
  683. xTEXTIN  115   85 130 20 'WWW' WWW.tmp '' 100
  684.     GadID 570
  685.     GadHelp 'Command to start your WWW browser - uses AWeb if left blank'
  686. xBUTTON  247   85  23 20 '?'
  687.     GadHelp 'Open a file requester to choose browser'
  688.     Extract WWW.tmp PATH Path.tmp
  689.     Extract WWW.tmp FILE File.tmp
  690.     CLI 'RequestFile drawer "$Path.tmp" file "$File.tmp" title "Path to WWW program" noicons >ENV:.temp'
  691.     if $$RETCODE = 0
  692.         WWW.tmp = $.temp
  693.         Update $UserGui 570 $WWW.tmp
  694.         endif
  695. xTEXTIN  385   85 130 20 'FTP' FTP.tmp '' 100
  696.     GadID 575
  697.     GadHelp 'Command to start your FTP program - uses AmiFTP if left blank'
  698. xBUTTON  517   85  23 20 '?'
  699.     GadHelp 'Open a file requester to choose FTP program'
  700.     Extract FTP.tmp PATH Path.tmp
  701.     Extract FTP.tmp FILE File.tmp
  702.     CLI 'RequestFile drawer "$Path.tmp" file "$File.tmp" title "Path to FTP program" noicons >ENV:.temp'
  703.     if $$RETCODE = 0
  704.         FTP.tmp = $.temp
  705.         Update $UserGui 575 $FTP.tmp
  706.         endif
  707. xTEXTIN  115  110 155 20 'User Button A' ButtonA.tmp '' 50
  708.     GadID 580
  709.     GadHelp 'Text to appear in the first User Button - see Help from main menu'
  710. xTEXTIN  385  110 155 20 'User Button B' ButtonB.tmp '' 50
  711.     GadID 585
  712.     GadHelp 'Text to appear in the second User Button - see Help from main menu'
  713. ;;;
  714. ;;; Buttons
  715. xBUTTON 200 145 60 25 '_OK'
  716.     GadHelp 'Accept these settings'
  717.     UserName   = $UserName.tmp
  718.     NodeName   = $NodeName.tmp
  719.     MailBox    = $MailBox.tmp
  720.     DomainName = $DomainName.tmp
  721.     IPAddress  = $IPAddress.tmp
  722.     Password   = $Password.tmp
  723.     ButtonA    = $ButtonA.tmp
  724.     ButtonB    = $ButtonB.tmp
  725.     Extract WWW.tmp UNQUOTE WWW
  726.     Extract FTP.tmp UNQUOTE FTP
  727.     Gosub $UserGui ExitUser
  728.  
  729. xBUTTON 315 145 60 25 '_Cancel'
  730.     GadHelp 'Exit without changing settings'
  731.     Gosub $UserGui ExitUser
  732. ;;;
  733. ;;; Exit Window
  734. xROUTINE ExitUser
  735.     GuiClose $UserGui
  736.     GuiOpen $PrefsGui
  737.     Return
  738. ;;;
  739.  
  740. ;;; *** FTP Window ***
  741. NewFile FTP.g
  742. VarPath 'Dashboard/Prefs.g'
  743. WINBIG 15 15 575 105 'FTP Preferences'
  744. WINTYPE 0111000
  745. ;;;
  746. ;;; On Open
  747. xOnOPEN
  748.     AminetServer.tmp = $AminetServer
  749.     DownloadDir.tmp  = $DownloadDir
  750.     AminetRoot.tmp   = $AminetRoot
  751.     GetReadme.tmp    = $GetReadme
  752.  
  753.     Update $FTPGui 710 $AminetServer.tmp
  754.     Update $FTPGui 720 $DownloadDir.tmp
  755.     Update $FTPGui 730 $AminetRoot.tmp
  756.     Update $FTPGui 740 $GetReadme.tmp
  757.  
  758. ;;;
  759. ;;; Gadgets
  760. xTEXTIN  115 10 135 20 'AminetServer' AminetServer.tmp '' 30
  761.     GadID 710
  762.     GadHelp 'Address for Aminet downloads - uk.aminet.net is usually fastest'
  763. ;xBUTTON  247 10  23 20 '?'
  764. ;    GadHelp 'Open a list of Aminet sites'
  765. ;    xLISTVIEW 10 10 200 100 'Aminet servers' Server.tmp 'Wirenet:db/aminet.sites' 2 TXT
  766. xTEXTIN  115 35 155 20 'DownloadDir' DownloadDir.tmp '' 100
  767.     GadID 720
  768.     GadHelp 'Directory to save Aminet downloads'
  769. xTEXTIN  385 10 155 20 'AminetRoot' AminetRoot.tmp '' 30
  770.     GadID 730
  771.     GadHelp 'Path to Aminet files on server, normally left blank'
  772. xCheckBox 385 35  21 17 'GetReadme' GetReadme.tmp '1' '0' OFF
  773.     GadID 740
  774.     GadHelp 'Collect readme file for each download'
  775. ;;;
  776. ;;; Buttons
  777. xBUTTON 200 75 60 25 '_OK'
  778.     GadHelp 'Accept these settings'
  779.     AminetServer = $AminetServer.tmp
  780.     DownloadDir  = $DownloadDir.tmp
  781.     AminetRoot   = $AminetRoot.tmp
  782.     GetReadme    = $GetReadme.tmp
  783.     Gosub $FTPGui ExitFTP
  784.  
  785. xBUTTON 315 75 60 25 '_Cancel'
  786.     GadHelp 'Exit without changing settings'
  787.     Gosub $FTPGui ExitFTP
  788. ;;;
  789. ;;; Exit Window
  790. xROUTINE ExitFTP
  791.     GuiClose $FTPGui
  792.     GuiOpen $PrefsGui
  793.     Return
  794. ;;;
  795.  
  796.